# -*- coding: utf-8 -*-
"""
date: Mon Dec 17 14:41:11 2018
python: Anaconda 3.6.5
author: kanade
email: kanade@blisst.cn
"""
import numpy as np
import matplotlib.pyplot as mp
from mpl_toolkits.mplot3d import axes3d


# 生成数据
n = 1000
x, y = np.meshgrid(np.linspace(-3, 3, n),
                   np.linspace(-3, 3, n))
z = (1 - x / 2 + x ** 5 + y ** 3) * np.exp(
    -x ** 2 - y ** 2)

mp.figure('3D Wireframe')
ax = mp.gca(projection='3d')
mp.title('3D Wireframe', fontsize=20)
# 设置坐标轴标签
ax.set_xlabel('x', fontsize=14)
ax.set_ylabel('y', fontsize=14)
ax.set_zlabel('z', fontsize=14)
# 绘制三维线框图
ax.plot_wireframe(
    x, y, z, rstride=30, cstride=30,
    linewidth=0.5, color='dodgerblue')

mp.figure('3D Surface')
ax = mp.gca(projection='3d')

mp.title('3D Surface', fontsize=20)

ax.set_xlabel('x', fontsize=14)
ax.set_ylabel('y', fontsize=14)
ax.set_zlabel('z', fontsize=14)
# 绘制三维表面图
ax.plot_surface(
    x, y, z, rstride=10, cstride=10, cmap='jet')


mp.show()
